package per.wei.diary.entity;

import java.time.OffsetDateTime;
import java.util.Calendar;
import java.util.Date;

public class MyDateTime extends MyDate{
	private int hour;
	private int minite;
	private int second;
	
	public MyDateTime() {}

	public long toTimestamp() {
		Calendar calendar = Calendar.getInstance();
		calendar.set(getYear(), getMonth(), getDay(), hour, minite, second);
		return calendar.getTimeInMillis();
	}
	
	public void setDateTime(long timestamp) {
		Calendar calendar = Calendar.getInstance();
		calendar.setTimeInMillis(timestamp);
		this.setYear(calendar.get(Calendar.YEAR));
		this.setYear(calendar.get(Calendar.YEAR));
	}
	
	public int getHour() {
		return hour;
	}

	public void setHour(int hour) {
		this.hour = hour;
	}

	public int getMinite() {
		return minite;
	}

	public void setMinite(int minite) {
		this.minite = minite;
	}

	public int getSecond() {
		return second;
	}

	public void setSecond(int second) {
		this.second = second;
	}
	
	
}
